window._DYM = {

    showToast:function(message){
		
		
		tt.showToast({
		  title: message,
		  duration: 2000,
		  success(res) {
			console.log(`${res}`);
		  },
		  fail(res) {
			console.log(`showToast调用失败`);
		  },
		});
		
		
	},

    showCustomAd:function(){
		
		
		
	},
	
	showLbVideo:function(){

        if(cc.sys.platform === cc.sys.BYTEDANCE_GAME){

            if(!window.videoLbAd){
                    
                console.log("视频初始化");
        
                window.videoLbAd = tt.createRewardedVideoAd({adUnitId: '3wuosrljutk4gk2365'})
                
                window.videoLbAd.onError(err => {
                    tt.hideLoading();
                    console.log(err);
                })
                
                window.videoLbAd.onClose((data) => {
                    
                    
                    tt.hideLoading();
                    if (data.isEnded) {
                        
                        console.log('播放完成');
						_LOCALJF.addJIFEN(50);
						_LOCALJF.addRandom(50);
						if(window._RANDOM){
							window._RANDOM.refreshJfLabel(null,null);
						}else{
							_HTTP.getJf();
						}

                    } else {
                        
                        _DYM.showToast('未完成观看');
                        
                    }
                
                })
                
                window.videoLbAd.load();
                
            }
            
            tt.showLoading();
            // 用户触发广告后，显示激励视频广告
            window.videoLbAd.show();

        }
		
		
		
	},

}